<ui:composition template="template/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.org/rich" >

    <ui:define name="conteudo">
 
        <h:form>
        
            <h:outputText value="Consulta de Investimentos" styleClass="tituloPagina" />
            
           <div  class="imagemImprimir" id="print">
                <h:commandButton onclick="javascript:window.print()"  image="/estatico/images/botao_imprimir.gif" value="Imprimir"/>
            </div>


            <rich:dataTable id="investidores" value="#{investimentosMB.listaInvestimentos}" var="i" styleClass="tabela" rowClasses="tb_linha1, tb_linha2" headerClass="tb_header">

                <rich:column>
                    
                    <f:facet name="header">
                        <h:outputText value="Nome"/>
                    </f:facet>
                    
                    <h:outputText value="#{i.pessoa}"/>
                    
                </rich:column>

                <rich:column styleClass="tb_coluna_m">
                    
                    <f:facet name="header">
                        <h:outputText value="Investimento"/>
                    </f:facet>
                    
                    <h:outputText value="#{i.total}" >
                         <f:convertNumber pattern="R$ #,##0.00" minFractionDigits="2" />
                    </h:outputText>
                    
                </rich:column>
                
                 <f:facet name="footer">

                    <rich:columnGroup rendered="#{!empty investimentosMB.listaInvestimentos}">
                        <rich:column style="text-align: left; " >Total</rich:column>
                        <rich:column style="text-align: left; ">
                            <h:outputText  value="#{investimentosMB.total.totalValor}" >
                                <f:convertNumber pattern="R$ #,##0.00" minFractionDigits="2" />
                            </h:outputText>
                        </rich:column>
                        <rich:column breakRowBefore="true" style="text-align: left; ">Media</rich:column>
                        <rich:column style="text-align: left; ">
                            <h:outputText  value="#{investimentosMB.total.mediaValor}" >
                                <f:convertNumber pattern="R$ #,##0.00" minFractionDigits="2" />
                            </h:outputText>
                        </rich:column>
                    </rich:columnGroup>
                     
                 </f:facet>
            </rich:dataTable>
            
             <div align="center"  >
                 <h:outputText value=" Lista Vazia " styleClass="mensagemListaVazia" rendered="#{empty investimentosMB.listaInvestimentos }"   />
             </div>   

         </h:form>

    </ui:define>
</ui:composition>